package com.huluobo.a2208mdmdemo2

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.huluobo.apps.AppsPage
import com.huluobo.document.view.DocPage
import com.huluobo.document.view.LocalPage
import com.huluobo.lib_base.RoutePath
import com.huluobo.report.view.ReportCommitPage
import com.huluobo.report.view.ReportPage
import com.huluobo.sign.view.SignCommitPage
import com.huluobo.sign.view.SignPage
import com.huluobo.user.view.AddApprovePage
import com.huluobo.user.view.AddEmployeePage
import com.huluobo.user.view.ApproveListPage
import com.huluobo.user.view.ApprovePage
import com.huluobo.user.view.LoginPage
import com.huluobo.user.view.MinePage
import com.huluobo.user.view.RegisterPage
import com.huluobo.user.view.SPPage

/**
 *  Created by LC on 2025/2/5.
 */
@Composable
fun MyNavHost(it: PaddingValues, navController: NavHostController) {
    NavHost(
        modifier = Modifier.padding(it),
        navController = navController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { MessagePage(navController) }
            composable(RoutePath.HOME) { HomePage(navController) }
            composable(RoutePath.MINE) { MinePage(navController) }
            composable(RoutePath.APPS) { AppsPage(navController) }
            composable(RoutePath.DOC) { DocPage(navHostController = navController) }
            composable(RoutePath.LOCAL) { LocalPage(navHostController = navController) }
            composable(RoutePath.REPORT) { ReportPage(navHostController = navController) }
            composable(RoutePath.COMMIT_REPORT + "/{report}") {
                val report = it.arguments?.getString("report", "").toString()
                ReportCommitPage(navHostController = navController, json = report)
            }
            composable(RoutePath.SIGN) { SignPage(navHostController = navController) }
            composable(RoutePath.SIGN_COMMIT) { SignCommitPage(navHostController = navController) }
            composable(RoutePath.REGISTER) { RegisterPage(navHostController = navController) }
            composable(RoutePath.LOGIN) { LoginPage(navHostController = navController) }
            composable(RoutePath.ADD_EMPLOYEE) { AddEmployeePage(navHostController = navController) }
            composable(RoutePath.ADD_APPROVE) { AddApprovePage(navHostController = navController) }
            composable(RoutePath.APPROVE_LIST) { ApproveListPage(navHostController = navController) }
            composable(RoutePath.APPROVE_DETAIL + "/{approve}") {
                val approve = it.arguments?.getString("approve", "").toString()
                ApprovePage(navHostController = navController, json = approve)
            }
            composable(RoutePath.SP + "/{approve}") {
                val approve = it.arguments?.getString("approve", "").toString()
                SPPage(navHostController = navController, json = approve)
            }
        })
}